public class ArrayDemo {
    public static void main(String[] args) {
        // 方式1：声明并初始化
        int[] scores = {85, 92, 78, 90, 88};
        
        // 方式2：先声明，后初始化
        double[] prices = new double[5];
        prices[0] = 12.5;
        prices[1] = 8.9;
        prices[2] = 15.0;
        prices[3] = 7.2;
        prices[4] = 9.8;
        
        // 方式3：声明时指定长度
        String[] names = new String[3];
        names[0] = "张三";
        names[1] = "李四";
        names[2] = "王五";
    }
}
